<?php
	$this->post_model->list_where = 'hot > 0 AND type != 2 AND published = 1';
	$this->post_model->list_orderby = array('hot desc', 'id desc');
	$items = $this->post_model->getList(18);
?>
<div class="latest_hot clearfix">
	<div class="col_lft">
		<div class="newshot0 clearfix">
			<?php
				foreach($items as $k=>$itm):
					if($k==13) break;
					$link = siteUrl('post/detail/'.$itm->id.'-'.$itm->alias, $itm->category_id);
			?>
				<div class="item row<?= $k ?>">
					<div class="postImage">
						<a href="<?= $link ?>">
							<img alt="<?= html_escape($itm->title) ?>" src="<?php if(!$k) echo thumb($itm->image, 558, 418); else echo thumb($itm->image, 255, 191); ?>" />
							<?php if($itm->source_id == 2): ?><span title="Bản quyền myten.vn" class="myten_product"><img src="<?= base_url(); ?>images/myten_pro.png" alt="Bản quyền" /></span><?php endif ?>
						</a>
					</div>
					<div class="postText">
						<h3><a class="postMore" href="<?= $link ?>"><?= $itm->title ?></a></h3>
						<?php if(!$k): ?><div class="postDescription"><?= word_limiter($itm->description, 30) ?></div><?php endif ?>
					</div>
				</div>
			<?php 
				unset($items[$k]);
			endforeach; ?>
		</div>
	</div>
	<div class="col_rgt">
		<div class="col1">
			<div class="newshot2 clearfix">
				<?php
					foreach($items as $k=>$itm):
						if($k==15) break;
						$link = siteUrl('post/detail/'.$itm->id.'-'.$itm->alias, $itm->category_id);
				?>
					<div class="item row<?= $k ?>">
						<div class="postImage">
							<a href="<?= $link ?>">
								<img alt="<?= html_escape($itm->title) ?>" src="<?= thumb($itm->image, 250, 188); ?>" />
								<?php if($itm->source_id == 2): ?><span title="Bản quyền myten.vn" class="myten_product"><img src="<?= base_url(); ?>images/myten_pro.png" alt="Bản quyền" /></span><?php endif ?>
							</a>
						</div>
						<div class="postTitle">
							<h3><a class="postMore" href="<?= $link ?>"><?= $itm->title ?></a></h3>
						</div>
						<div class="postDescription"><?= word_limiter($itm->description, 15) ?></div>
					</div>
				<?php 
					unset($items[$k]);
				endforeach; ?>
			</div>
			<div class="popular">
				<ul>
				<?php
					foreach($items as $k=>$itm):
						$link = siteUrl('post/detail/'.$itm->id.'-'.$itm->alias, $itm->category_id);
				?>
					<li class="item row"><a class="postMore" href="<?= $link ?>"><?= $itm->title ?></a></li>
				<?php 
					unset($items[$k]);
				endforeach; ?>
				</ul>
			</div>
		</div>
		<div class="col2">
			<?php $this->load->view('frontend/video_week'); ?>
		</div>
		<div class="clr"></div>
		<div class="hot_events">
			<h2><a href="javascript:void()">Sự kiện <strong>nóng</strong></a></h2>
			<div class="eventItems clearfix">
			<?php
				$this->post_model->list_where = 'subject_hot > 0 AND type != 2 AND published = 1';
				$this->post_model->list_orderby = array('subject_hot desc', 'id desc');
				$items = $this->post_model->getList(6);
				foreach($items as $k=>$itm):
					$link = siteUrl('post/detail/'.$itm->id.'-'.$itm->alias, $itm->category_id);
					if(!$k):
			?>
					<div class="big_item">
							<div class="postImage">
								<a href="<?= $link ?>">
									<img alt="<?= html_escape($itm->title) ?>" src="<?= thumb($itm->image, 480, 360); ?>" />
									<?php if($itm->source_id == 2): ?><span title="Bản quyền myten.vn" class="myten_product"><img src="<?= base_url(); ?>images/myten_pro.png" alt="Bản quyền" /></span><?php endif ?>
								</a>
							</div>
							<div class="postText">
								<h4><a href="<?= $link ?>"><?= $itm->title ?></a></h4>
							</div>
					</div>
				<?php else: ?>
					<?php if($k==1): ?>
						<div class="more_items">
					<?php endif ?>
					<?php if($k<=2): ?>
							<div class="item">
								<div class="postImage">
									<a href="<?= $link ?>">
										<img alt="<?= html_escape($itm->title) ?>" src="<?= thumb($itm->image, 480, 360); ?>" />
										<?php if($itm->source_id == 2): ?><span title="Bản quyền myten.vn" class="myten_product"><img src="<?= base_url(); ?>images/myten_pro.png" alt="Bản quyền" /></span><?php endif ?>
									</a>
								</div>
								<div class="postText">
									<h4><a href="<?= $link ?>"><?= $itm->title ?></a></h4>
								</div>
							</div>
					<?php else: ?>
						<?php if($k==3): ?>
							<div class="clr"></div>
							<ul class="more_items_link">
						<?php endif ?>
							<li><a href="<?= $link ?>"><?= $itm->title ?></a></li>
					<?php endif ?>
				<?php endif ?>
			<?php endforeach ?>
					</ul><!-- more_items_link-->
				</div><!--more_items -->
			</div>
		</div><!-- hotevents -->
	</div>
</div><!-- latest_hot -->